import { API_CONFIG } from "../config/index.js"
import  request from "../api/index.js"


export const fetchMenus = (labelname,username) =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.menusApi,{"labelname": labelname,"username": username},"POST",2000)
}
export const getMenusListInfoHandler = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getMenusListInfoApi,{},"GET",2000)
}

export const addMenusListInfoHandler = (data) =>{
    return request(API_CONFIG.addMenusListInfoApi,data,"POST",2000)
}

export const updateMenusListInfoHandler = (id,data) =>{
    return request(API_CONFIG.updateMenusListInfoApi(id),data,"PUT",2000)
}

export const delMenusListInfoHandler = (id) =>{
    return request(API_CONFIG.delMenusListInfoApi(id),{},"DELETE",2000)
}